<?php

namespace app\index\controller;
use app\comm\controller\WebLogController;
use app\comm\Tools\pay\PayTool;
use app\comm\service\SysToolsLevePoint;
use app\index\service\PayService;

//支付类控制器

class Pay extends WebLogController {

	/**
	 * 支付首页
	 * @return [type] [description]
	 */
	public function pay(){
		$parm = request()->post();
		$parm["uid"] = $this->userinfo["uid"];
		$parm["nickname"] = $this->userinfo["nickname"];
		$parm["user"] =  $this->userinfo;
		$payservice  = new PayService;

		$parresutl = $payservice ->payyue($parm);

		if($parresutl==1){
			//已经付款，不要重复付款
			//$this->redirect('index/user/index');
			$name = "已经付款，不要重复付款";
		}
		if($parresutl==2){
			//已经付款，不要重复付款
			//$this->redirect('index/user/index');
			$name = "余额不足";
		}
		if($parresutl==3){
			//已经付款，不要重复付款
			//$this->redirect('index/user/index');
			$name = "付款完成";
		}
		$this->assign('name',$name);
		return view("pay/pay");
		
	}


}